package com.example.client;


import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class ClientController {

    @RequestMapping(value = "/call/{id}",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
    public Police call(@PathVariable Integer id, HttpServletRequest httpServletRequest){
        Police p=new Police();
        p.setId(id);
        p.setName("carmen");
        p.setMessage(httpServletRequest.getRequestURL().toString());
        return p;
    }
    
    
    @RequestMapping(value = "/hello/{name}",method = RequestMethod.GET)
    public String hello(@PathVariable String name){
    	return "hello world"+name;
    }
    
    



}
